package com.virtualperson.service.impl;

import com.virtualperson.service.AudioProcessingService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class AudioProcessingServiceImpl implements AudioProcessingService {

    @Value("${ffmpeg.default-audio-duration:30}")
    private float defaultAudioDuration;

    @Override
    public float getAudioDuration(String audioUrl) {
        try {
            // 直接返回默认时长
            log.info("使用默认音频时长: {}秒", defaultAudioDuration);
            return defaultAudioDuration;
        } catch (Exception e) {
            log.error("获取音频时长失败: {}", audioUrl, e);
            throw new RuntimeException("获取音频时长失败: " + e.getMessage());
        }
    }
} 